﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Http;

namespace Woodbase.CodeBase.Utils
{
    public class HttpContentHelper
    {
        public static HttpContent CreateContentFromObject<T>(T obj)
        {
            return HttpContentExtensions.CreateXmlSerializable(obj);
        }

        public static T CreateObjectFromContent<T>(HttpContent content)
        {
            return content.ReadAsXmlSerializable<T>();
        }
    }
}
